<!DOCTYPE HTML>
<html  xmlns:th="http://www.thymeleaf.org">
<head th:include="_meta :: header">
    <title>分配</title>
</head>
<body>
<!--<div class="layui-fluid">-->
<!--    <div class="layui-row">-->
<!--        <form class="layui-form form form-horizontal"  id="form-audio-allot" action="#" th:action="@{/admin/allot/AudioAllotAll}" method="post">-->
<!--            <select id="usernameList" name="usernameList" >-->
<!--                <option value="" text="请选择" class="downUsername">请选择</option>-->
<!--                <option th:each="z:${usernameList}"  th:value="${z}" th:text="${z}" class="downUsername"-->
<!--                >${z.value}-->
<!--                </option>-->
<!--            </select>-->
<!--            <input id="idsBus" th:value="${idsBus}" name="idsBus"/>-->
<!--            <button  class="layui-btn" id="subbtn" type="submit">-->
<!--                <i class="layui-icon">&#xe605;</i> 确认分配</a>-->
<!--            </button>-->
<!--        </form>-->
<!--    </div>-->
<!--</div>-->

<form class="layui-form form form-horizontal"  id="form-audioVideo-refuse" action="#" method="post">

    <div style="margin-left:20px">
        <input type="hidden" name="id" th:value="${id}"/>
        <div>请填写驳回理由：</div>
        <div>
            <div> </div>
            <textarea id="reason"  name="reason" cols="80" rows="20" ></textarea>
        </div>
        <button  style="margin:20px" class="layui-btn" id="subbtn" type="submit">
            <i class="layui-icon">&#xe605;</i>提交</a>
        </button>
    </div>
</form>

<!--            <form class="layui-form form form-horizontal"  id="form-audioVideo-refuse" action="#" th:action="@{/admin/video/refuseAudioVideo}" method="post">-->
<!--                 <textarea type="text" rows="4" cols="40" name="reason" id="reason" style="margin: 20px;" th:value="${reason}"/></textarea>-->
<!--                <input type="text" name="id" th:value="${id}" hidden/>-->
<!--                <div> </div>-->
<!--                <button  class="layui-btn" id="subbtn" type="submit" style="margin-left: 60px;">-->
<!--                    <i class="layui-icon">&#xe605;</i>拒绝</a>-->
<!--                </button>-->
<!--            </form>-->

<!--_footer 作为公共模版分离出去-->
<div th:replace="_footer :: footerjs">
</div>
<!--/_footer 作为公共模版分离出去-->
<script>
    layui.use(['laydate','form'], function(){
        var laydate = layui.laydate;
        var form = layui.form;
        // 监听全选
        form.on('checkbox(checkall)', function(data){

            if(data.elem.checked){
                $('tbody input').prop('checked',true);
            }else{
                $('tbody input').prop('checked',false);
            }
            form.render('checkbox');
        });
        form.on('select(selectchange)', function(data){
            console.log(data.value); //得到被选中的值
            var pageNo = $('#pageNo');
            var Form = $('form')
            pageNo.val(1);
            Form.submit();
            form.render('select');
        });
        //日期时间范围选择
        laydate.render({

        });
        lay('.timeSpace').each(function(){
            laydate.render({
                elem: this
                ,type: 'datetime'
                ,range: true //或 range: '~' 来自定义分割字符
            });
        });
    });



    // 表单提交
    $(function(){
        // var idsBus = $('input[id="idsBus"]').val();
        // console.log("allot -->"+idsBus)
        //  var downUsername = $('option[class="downUsername"]').val();
        // console.log("downUsername--> {}",downUsername)
        //  if(downUsername.trim().length == 0){
        //      layer.msg("您还未选择要分配的下属");
        //      return;
        //  }else{
        $("#form-audioVideo-refuse").validate({
            rules:{
                reason:{
                    required: true,
                },
            },
            submitHandler:function(form){
                $(form).ajaxSubmit({
                    type: 'GET',
                    url: "/admin/video/refuseAudioVideo",
                    success: function(data){
                        if(data.code == "1"){
                            selfmsg('拒绝成功!',1,function(){
                                var index = parent.layer.getFrameIndex(window.name);
                                parent.location.reload();
                                parent.layer.close(index);
                            });
                        }else{
                            selfmsg('拒绝失败!');
                        }
                    },
                    error: function(){
                        selfmsg('拒绝异常!',5);
                    }
                });
            }
        });
        // }
    });


</script>
</body>
</html>